<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>生命记录 | 人生时光轴</title>
    <!-- 预加载关键资源 -->
    <link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" as="style">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    
    <!-- 内联关键CSS -->
    <style>
        :root {
            --color01: #534739; /* 深棕色 */
            --color02: #9E8774; /* 棕褐色 */
            --color03: #F0F2F1; /* 米白色 */
            --color04: #1F2D33; /* 深青色 */
            --color05: #0D0D0C; /* 近黑色 */
            
            --glass: rgba(240, 242, 241, 0.75);
            --glass-border: rgba(255, 255, 255, 0.4);
            --glass-shadow: rgba(83, 71, 57, 0.2);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background: linear-gradient(135deg, #F0F2F1 0%, #e8eaea 100%);
            color: var(--color01);
            min-height: 100vh;
            overflow-x: hidden;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 20px;
        }

        .navbar {
            position: sticky;
            top: 0;
            z-index: 100;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 30px;
            background: var(--glass);
            backdrop-filter: blur(12px) saturate(180%);
            -webkit-backdrop-filter: blur(12px) saturate(180%);
            border-radius: 0 0 20px 20px;
            margin-bottom: 20px;
            box-shadow: 0 4px 20px var(--glass-shadow);
            border: 1px solid var(--glass-border);
            border-top: none;
        }

        .content-area {
            background: var(--glass);
            backdrop-filter: blur(12px) saturate(180%);
            -webkit-backdrop-filter: blur(12px) saturate(180%);
            border-radius: 20px;
            padding: 30px;
            box-shadow: 0 8px 32px var(--glass-shadow);
            border: 1px solid var(--glass-border);
        }

        .records-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 25px;
            margin-bottom: 30px;
        }

        .record-card {
            background: rgba(255, 255, 255, 0.8);
            border-radius: 20px;
            overflow: hidden;
            box-shadow: 0 4px 20px var(--glass-shadow);
            border: 1px solid var(--glass-border);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            display: flex;
            flex-direction: column;
        }

        .record-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 12px 30px rgba(83, 71, 57, 0.25);
        }
    </style>
    
    <!-- 非关键CSS延迟加载 -->
    <link rel="stylesheet" href="styles.css" media="print" onload="this.media='all'">
    <noscript><link rel="stylesheet" href="styles.css"></noscript>
    
    <style>
        /* 剩余样式 */
        .logo {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .logo-icon {
            font-size: 28px;
            color: var(--color04);
        }

        .logo-text {
            font-size: 24px;
            font-weight: 600;
            letter-spacing: 1px;
            background: linear-gradient(45deg, var(--color05), var(--color01));
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .nav-toggle {
            display: none;
            font-size: 24px;
            color: var(--color01);
            cursor: pointer;
        }

        .nav-links {
            display: flex;
            gap: 20px;
        }

        .nav-link {
            text-decoration: none;
            color: var(--color01);
            font-size: 16px;
            font-weight: 500;
            padding: 8px 14px;
            border-radius: 50px;
            transition: all 0.3s ease;
            position: relative;
        }

        .nav-link:hover {
            background: rgba(255, 255, 255, 0.3);
            color: var(--color04);
        }

        .nav-link.active {
            background: rgba(158, 135, 116, 0.2);
            color: var(--color04);
        }

        .nav-link.active::after {
            content: '';
            position: absolute;
            bottom: -6px;
            left: 50%;
            transform: translateX(-50%);
            width: 6px;
            height: 6px;
            background: var(--color04);
            border-radius: 50%;
        }

        .user-actions {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .search-box {
            display: flex;
            align-items: center;
            background: rgba(255, 255, 255, 0.6);
            border-radius: 50px;
            padding: 6px 12px;
        }

        .search-box input {
            background: transparent;
            border: none;
            outline: none;
            padding: 5px 10px;
            width: 160px;
            color: var(--color01);
            font-size: 15px;
        }

        .search-box i {
            color: var(--color02);
        }

        .user-profile {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(45deg, var(--color02), var(--color01));
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--color03);
            font-weight: bold;
            cursor: pointer;
            box-shadow: 0 4px 12px var(--glass-shadow);
            transition: transform 0.3s ease;
        }

        .user-profile:hover {
            transform: scale(1.05);
        }

        .action-buttons {
            display: flex;
            gap: 15px;
            justify-content: center;
            margin-top: 15px;
        }

        .action-btn {
            padding: 10px 24px;
            border-radius: 50px;
            border: none;
            font-weight: 500;
            font-size: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            background: linear-gradient(135deg, var(--color02), var(--color01));
            color: var(--color03);
            box-shadow: 0 4px 15px rgba(83, 71, 57, 0.2);
        }

        .action-btn.secondary {
            background: rgba(255, 255, 255, 0.7);
            color: var(--color01);
            border: 1px solid var(--glass-border);
        }

        .action-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 20px rgba(83, 71, 57, 0.25);
        }

        .action-btn.secondary:hover {
            background: rgba(255, 255, 255, 0.9);
        }

        .main-content {
            margin-bottom: 40px;
        }

        .section-header {
            margin-bottom: 30px;
            text-align: center;
            padding: 20px;
            background: rgba(255, 255, 255, 0.4);
            border-radius: 15px;
            backdrop-filter: blur(5px);
            border: 1px solid var(--glass-border);
        }

        .section-title {
            font-size: 32px;
            margin-bottom: 12px;
            background: linear-gradient(45deg, var(--color05), var(--color01));
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .section-subtitle {
            font-size: 18px;
            color: var(--color02);
            margin: 0 auto 20px;
            max-width: 800px;
            line-height: 1.6;
        }

        .record-filters {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 30px;
            justify-content: center;
        }

        .filter-tag {
            padding: 8px 18px;
            border-radius: 50px;
            background: rgba(255, 255, 255, 0.6);
            border: 1px solid var(--glass-border);
            color: var(--color01);
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .filter-tag:hover {
            background: rgba(255, 255, 255, 0.8);
            transform: translateY(-2px);
        }

        .filter-tag.active {
            background: linear-gradient(135deg, var(--color02), var(--color01));
            color: var(--color03);
        }

        .record-image {
            height: 180px;
            background: linear-gradient(135deg, var(--color02), var(--color01));
            position: relative;
            overflow: hidden;
        }

        .record-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }

        .record-card:hover .record-image img {
            transform: scale(1.05);
        }

        .record-category {
            position: absolute;
            top: 15px;
            left: 15px;
            padding: 5px 12px;
            border-radius: 50px;
            font-size: 13px;
            font-weight: 500;
            background: rgba(255, 255, 255, 0.9);
            color: var(--color01);
            backdrop-filter: blur(5px);
        }

        .record-content {
            padding: 20px;
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .record-date {
            font-size: 14px;
            color: var(--color02);
            margin-bottom: 8px;
        }

        .record-title {
            font-size: 19px;
            color: var(--color05);
            margin-bottom: 12px;
            font-weight: 600;
        }

        .record-desc {
            color: var(--color01);
            font-size: 15px;
            line-height: 1.6;
            margin-bottom: 20px;
            flex: 1;
        }

        .record-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-top: 15px;
            border-top: 1px solid rgba(158, 135, 116, 0.1);
        }

        .record-tags {
            display: flex;
            gap: 8px;
        }

        .record-tag {
            font-size: 12px;
            padding: 3px 10px;
            border-radius: 50px;
            background: rgba(158, 135, 116, 0.1);
            color: var(--color02);
        }

        .record-actions {
            display: flex;
            gap: 10px;
        }

        .record-action {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.7);
            color: var(--color02);
            border: 1px solid rgba(158, 135, 116, 0.2);
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .record-action:hover {
            background: var(--color02);
            color: var(--color03);
        }

        .pagination {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-top: 40px;
        }

        .page-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.6);
            border: 1px solid var(--glass-border);
            color: var(--color01);
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .page-btn:hover {
            background: rgba(255, 255, 255, 0.9);
            transform: translateY(-2px);
        }

        .page-btn.active {
            background: linear-gradient(135deg, var(--color02), var(--color01));
            color: var(--color03);
        }

        @media (max-width: 1024px) {
            .nav-links {
                gap: 15px;
            }

            .nav-link {
                font-size: 15px;
                padding: 6px 12px;
            }

            .records-grid {
                grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            }
        }

        @media (max-width: 768px) {
            .nav-toggle {
                display: block;
            }

            .nav-links {
                position: fixed;
                top: 80px;
                right: -100%;
                flex-direction: column;
                background: var(--glass);
                backdrop-filter: blur(12px) saturate(180%);
                padding: 20px;
                border-radius: 15px 0 0 15px;
                box-shadow: -5px 0 15px var(--glass-shadow);
                transition: right 0.3s ease;
                z-index: 99;
                border: 1px solid var(--glass-border);
            }

            .nav-links.active {
                right: 0;
            }

            .content-area {
                padding: 20px;
            }

            .section-title {
                font-size: 28px;
            }

            .action-btn {
                padding: 8px 18px;
                font-size: 14px;
            }
        }

        @media (max-width: 480px) {
            .navbar {
                padding: 12px 15px;
            }

            .logo-text {
                font-size: 20px;
            }

            .search-box {
                display: none;
            }

            .section-title {
                font-size: 24px;
            }

            .records-grid {
                grid-template-columns: 1fr;
            }
            
            .nav-links {
                top: 70px;
            }

            .filter-tag {
                padding: 6px 14px;
                font-size: 14px;
            }

            .action-buttons {
                flex-direction: column;
                gap: 10px;
            }

            .action-btn {
                width: 100%;
                justify-content: center;
            }
        }
    </style>
</head>

<body>
    <div class="container">
        <!-- 顶部导航栏 -->
        <nav class="navbar">
            <div class="logo">
                <div class="logo-icon">
                    <i class="fas fa-hourglass-half"></i>
                </div>
                <div class="logo-text">人生时光轴</div>
            </div>

            <div class="nav-toggle">
                <i class="fas fa-bars"></i>
            </div>

            <div class="nav-links">
                <a href="#" class="nav-link">时光轨迹</a>
                <a href="#" class="nav-link active">生命记录</a>
                <a href="#" class="nav-link">记忆中心</a>
                <a href="#" class="nav-link">蓝图规划</a>
                <a href="#" class="nav-link">人物自传</a>
                <a href="#" class="nav-link">时空胶囊</a>
            </div>

            <div class="user-actions">
                <div class="search-box">
                    <i class="fas fa-search"></i>
                    <input type="text" placeholder="搜索生命记录..." id="search-input">
                </div>
                <div class="user-profile">S</div>
            </div>
        </nav>

        <!-- 主内容区 -->
        <div class="main-content">
            <div class="content-area">
                <div class="section-header">
                    <h1 class="section-title">生命记录收藏馆</h1>
                    <p class="section-subtitle">每一段经历都是生命中独特的印记，这里收藏着您人生旅程中的珍贵时刻，记录着成长、感悟与蜕变。</p>

                    <div class="action-buttons">
                        <button class="action-btn">
                            <i class="fas fa-plus"></i> 新建记录
                        </button>
                        <button class="action-btn secondary">
                            <i class="fas fa-filter"></i> 筛选记录
                        </button>
                    </div>
                </div>

                <!-- 记录分类标签 -->
                <div class="record-filters">
                    <div class="filter-tag active">全部记录</div>
                    <div class="filter-tag">个人成长</div>
                    <div class="filter-tag">人际关系</div>
                    <div class="filter-tag">职业发展</div>
                    <div class="filter-tag">旅行见闻</div>
                    <div class="filter-tag">学习收获</div>
                    <div class="filter-tag">生活感悟</div>
                    <div class="filter-tag">重要事件</div>
                </div>

                <!-- 记录卡片网格 -->
                <div class="records-grid" id="records-container">
                    <!-- 记录卡片1 -->
                    <div class="record-card" data-category="旅行见闻">
                        <div class="record-image">
                            <picture>
                                <source srcset="https://source.unsplash.com/random/300x180/?nature" type="image/webp">
                                <img src="https://source.unsplash.com/random/300x180/?nature" alt="山间徒步的风景，远处有云海和山峰" loading="lazy">
                            </picture>
                            <div class="record-category">旅行见闻</div>
                        </div>
                        <div class="record-content">
                            <div class="record-date">2023年10月20日</div>
                            <h3 class="record-title">黄山日出观赏记</h3>
                            <p class="record-desc">凌晨四点起床登山，只为一睹黄山日出的壮丽景色。当第一缕阳光洒在云海之上，那一刻所有的疲惫都烟消云散，感受到了大自然的伟大与自身的渺小。</p>
                            <div class="record-meta">
                                <div class="record-tags">
                                    <span class="record-tag">自然</span>
                                    <span class="record-tag">感悟</span>
                                </div>
                                <div class="record-actions">
                                    <div class="record-action" data-action="edit"><i class="fas fa-edit"></i></div>
                                    <div class="record-action" data-action="like"><i class="fas fa-heart"></i></div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 记录卡片2 -->
                    <div class="record-card" data-category="重要事件">
                        <div class="record-image">
                            <picture>
                                <source srcset="https://source.unsplash.com/random/300x180/?graduation" type="image/webp">
                                <img src="https://source.unsplash.com/random/300x180/?graduation" alt="穿着毕业礼服的学生们抛起学士帽" loading="lazy">
                            </picture>
                            <div class="record-category">重要事件</div>
                        </div>
                        <div class="record-content">
                            <div class="record-date">2023年6月30日</div>
                            <h3 class="record-title">研究生毕业典礼</h3>
                            <p class="record-desc">今天正式从大学毕业，穿上了期待已久的毕业礼服。看着父母骄傲的眼神，突然意识到自己已经不再是学生，即将迎接人生新的阶段。</p>
                            <div class="record-meta">
                                <div class="record-tags">
                                    <span class="record-tag">毕业</span>
                                    <span class="record-tag">里程碑</span>
                                </div>
                                <div class="record-actions">
                                    <div class="record-action" data-action="edit"><i class="fas fa-edit"></i></div>
                                    <div class="record-action" data-action="like"><i class="fas fa-heart"></i></div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 记录卡片3 -->
                    <div class="record-card" data-category="生活感悟">
                        <div class="record-image">
                            <picture>
                                <source srcset="https://source.unsplash.com/random/300x180/?cooking" type="image/webp">
                                <img src="https://source.unsplash.com/random/300x180/?cooking" alt="丰盛的年夜饭餐桌，摆满各种菜肴" loading="lazy">
                            </picture>
                            <div class="record-category">生活感悟</div>
                        </div>
                        <div class="record-content">
                            <div class="record-date">2023年9月15日</div>
                            <h3 class="record-title">第一次独立做年夜饭</h3>
                            <p class="record-desc">第一次尝试独立做年夜饭，虽然过程手忙脚乱，但看到家人吃得开心的样子，觉得一切都值得。原来幸福可以如此简单，就是为爱的人做一顿饭。</p>
                            <div class="record-meta">
                                <div class="record-tags">
                                    <span class="record-tag">家庭</span>
                                    <span class="record-tag">美食</span>
                                </div>
                                <div class="record-actions">
                                    <div class="record-action" data-action="edit"><i class="fas fa-edit"></i></div>
                                    <div class="record-action" data-action="like"><i class="fas fa-heart"></i></div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 记录卡片4 -->
                    <div class="record-card" data-category="职业发展">
                        <div class="record-image">
                            <picture>
                                <source srcset="https://source.unsplash.com/random/300x180/?work" type="image/webp">
                                <img src="https://source.unsplash.com/random/300x180/?work" alt="办公环境中的电脑屏幕显示项目上线页面" loading="lazy">
                            </picture>
                            <div class="record-category">职业发展</div>
                        </div>
                        <div class="record-content">
                            <div class="record-date">2023年8月5日</div>
                            <h3 class="record-title">第一个独立负责的项目上线</h3>
                            <p class="record-desc">耗时三个月的项目今天终于正式上线了！从需求分析到设计开发，每一步都凝聚了团队的心血。看到用户的积极反馈，感受到了努力被认可的喜悦。</p>
                            <div class="record-meta">
                                <div class="record-tags">
                                    <span class="record-tag">工作</span>
                                    <span class="record-tag">成就</span>
                                </div>
                                <div class="record-actions">
                                    <div class="record-action" data-action="edit"><i class="fas fa-edit"></i></div>
                                    <div class="record-action" data-action="like"><i class="fas fa-heart"></i></div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 记录卡片5 -->
                    <div class="record-card" data-category="人际关系">
                        <div class="record-image">
                            <picture>
                                <source srcset="https://source.unsplash.com/random/300x180/?friends" type="image/webp">
                                <img src="https://source.unsplash.com/random/300x180/?friends" alt="几位朋友围坐在一起开心交谈" loading="lazy">
                            </picture>
                            <div class="record-category">人际关系</div>
                        </div>
                        <div class="record-content">
                            <div class="record-date">2023年7月10日</div>
                            <h3 class="record-title">十年老友重聚</h3>
                            <p class="record-desc">与大学室友们十年后重聚，虽然各自经历了不同的人生轨迹，但见面时依然亲切如初。时间改变了很多事情，却改变不了真正的友谊。</p>
                            <div class="record-meta">
                                <div class="record-tags">
                                    <span class="record-tag">友情</span>
                                    <span class="record-tag">回忆</span>
                                </div>
                                <div class="record-actions">
                                    <div class="record-action" data-action="edit"><i class="fas fa-edit"></i></div>
                                    <div class="record-action" data-action="like"><i class="fas fa-heart"></i></div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 记录卡片6 -->
                    <div class="record-card" data-category="个人成长">
                        <div class="record-image">
                            <picture>
                                <source srcset="https://source.unsplash.com/random/300x180/?reading" type="image/webp">
                                <img src="https://source.unsplash.com/random/300x180/?reading" alt="一本打开的书放在桌子上，旁边有一杯咖啡" loading="lazy">
                            </picture>
                            <div class="record-category">个人成长</div>
                        </div>
                        <div class="record-content">
                            <div class="record-date">2023年10月5日</div>
                            <h3 class="record-title">读完《人类简史》的思考</h3>
                            <p class="record-desc">花了两周时间读完《人类简史》，这本书彻底改变了我对人类发展的认知。意识到个体在历史长河中的渺小，同时也感受到思想的力量可以跨越时空。</p>
                            <div class="record-meta">
                                <div class="record-tags">
                                    <span class="record-tag">阅读</span>
                                    <span class="record-tag">思考</span>
                                </div>
                                <div class="record-actions">
                                    <div class="record-action" data-action="edit"><i class="fas fa-edit"></i></div>
                                    <div class="record-action" data-action="like"><i class="fas fa-heart"></i></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 分页控件 -->
                <div class="pagination">
                    <div class="page-btn" id="prev-page"><i class="fas fa-chevron-left"></i></div>
                    <div class="page-btn active" data-page="1">1</div>
                    <div class="page-btn" data-page="2">2</div>
                    <div class="page-btn" data-page="3">3</div>
                    <div class="page-btn" data-page="4">4</div>
                    <div class="page-btn" data-page="5">5</div>
                    <div class="page-btn" id="next-page"><i class="fas fa-chevron-right"></i></div>
                </div>
            </div>
        </div>
    </div>

    <!-- 延迟加载非关键JS -->
    <script defer>
        // 防抖函数
        function debounce(func, delay = 300) {
            let timer;
            return (...args) => {
                clearTimeout(timer);
                timer = setTimeout(() => func.apply(this, args), delay);
            };
        }

        // 页面加载完成后执行
        document.addEventListener('DOMContentLoaded', function() {
            // 移动端菜单切换
            const navToggle = document.querySelector('.nav-toggle');
            const navLinks = document.querySelector('.nav-links');
            
            navToggle.addEventListener('click', () => {
                navLinks.classList.toggle('active');
            });

            // 筛选标签切换 - 使用事件委托
            const filterContainer = document.querySelector('.record-filters');
            filterContainer.addEventListener('click', (e) => {
                const filterTag = e.target.closest('.filter-tag');
                if (filterTag) {
                    document.querySelectorAll('.filter-tag').forEach(tag => {
                        tag.classList.remove('active');
                    });
                    filterTag.classList.add('active');
                    
                    // 执行筛选逻辑
                    const category = filterTag.textContent;
                    filterRecords(category);
                }
            });

            // 记录卡片操作 - 使用事件委托
            const recordsContainer = document.getElementById('records-container');
            recordsContainer.addEventListener('click', (e) => {
                const actionBtn = e.target.closest('.record-action');
                if (actionBtn) {
                    const action = actionBtn.dataset.action;
                    const card = actionBtn.closest('.record-card');
                    const title = card.querySelector('.record-title').textContent;
                    
                    handleRecordAction(action, title);
                }
            });

            // 分页按钮 - 使用事件委托
            const paginationContainer = document.querySelector('.pagination');
            paginationContainer.addEventListener('click', (e) => {
                const pageBtn = e.target.closest('.page-btn[data-page]');
                if (pageBtn) {
                    document.querySelectorAll('.page-btn[data-page]').forEach(btn => {
                        btn.classList.remove('active');
                    });
                    pageBtn.classList.add('active');
                    
                    // 加载对应页数据
                    const page = parseInt(pageBtn.dataset.page);
                    loadPageData(page);
                }
            });

            // 搜索功能 - 添加防抖
            const searchInput = document.getElementById('search-input');
            searchInput.addEventListener('input', debounce((e) => {
                const searchTerm = e.target.value.trim().toLowerCase();
                searchRecords(searchTerm);
            }));

            // 筛选记录函数
            function filterRecords(category) {
                const cards = document.querySelectorAll('.record-card');
                
                cards.forEach(card => {
                    if (category === '全部记录' || card.dataset.category === category) {
                        card.style.display = 'flex';
                    } else {
                        card.style.display = 'none';
                    }
                });
            }

            // 搜索记录函数
            function searchRecords(term) {
                if (!term) {
                    // 如果搜索词为空，显示所有卡片
                    document.querySelectorAll('.record-card').forEach(card => {
                        card.style.display = 'flex';
                    });
                    return;
                }
                
                const cards = document.querySelectorAll('.record-card');
                
                cards.forEach(card => {
                    const title = card.querySelector('.record-title').textContent.toLowerCase();
                    const desc = card.querySelector('.record-desc').textContent.toLowerCase();
                    const tags = Array.from(card.querySelectorAll('.record-tag'))
                        .map(tag => tag.textContent.toLowerCase())
                        .join(' ');
                    
                    const content = `${title} ${desc} ${tags}`;
                    
                    if (content.includes(term)) {
                        card.style.display = 'flex';
                    } else {
                        card.style.display = 'none';
                    }
                });
            }

            // 处理记录操作
            function handleRecordAction(action, title) {
                switch(action) {
                    case 'edit':
                        console.log(`编辑记录: ${title}`);
                        // 编辑逻辑
                        break;
                    case 'like':
                        console.log(`点赞记录: ${title}`);
                        // 点赞逻辑
                        break;
                }
            }

            // 加载分页数据
            function loadPageData(page) {
                console.log(`加载第 ${page} 页数据`);
                // 实际项目中这里会发起AJAX请求加载对应页数据
                // 为了演示，这里仅做控制台输出
            }
        });
    </script>
</body>

</html>
    